package com.shengyin.ec.controller.shopcart;

import com.shengyin.ec.model.entity.Goods;

/**
 * @author Administrator
 *
 */
public class Item{
	
	private Goods goods;
	private int quantity;	
	//实际总价
	private float subtotal;
	//市场总价
	private float marketSubtotal;
	
	
	public Item() {
		super();
	}
	public Item(Goods goods, int quantity) {
		super();
		this.goods = goods;
		this.quantity = quantity;
	}
	public Goods getGoods() {
		return goods;
	}
	public void setGoods(Goods goods) {
		this.goods = goods;
	}
	public int getQuantity() {
		return quantity;
	}
	public void setQuantity(int quantity) {
		this.quantity = quantity;
	}
	public float getSubtotal() {
		this.subtotal=goods.getOurPrice()*this.quantity;
		return subtotal;
	}
	public void setSubtotal(float subtotal) {
		this.subtotal = subtotal;
	}
	public float getMarketSubtotal() {
		this.marketSubtotal=goods.getMarketPrice()*this.quantity;
		return marketSubtotal;
	}
	public void setMarketSubtotal(float marketSubtotal) {
		this.marketSubtotal = marketSubtotal;
	}

	public float getSubtotal(int quantity2) {
		this.subtotal=goods.getOurPrice()*(quantity2-this.quantity);
		return subtotal;
	}

	public float getMarketSubtotal(int quantity2) {
		this.subtotal=goods.getMarketPrice()*(quantity2-this.quantity);
		return subtotal;
	}
	
}
